#ifndef GOODS_H
#define GOODS_H

#include <QMainWindow>
//#include <QSqlTableModel>
#include <QSqlRelationalTableModel>
#include <QSpinBox>
#include <QFileDialog>
#include <QBuffer>
#include <QSqlQuery>
#include <QSqlDatabase>
#include <QSqlTableModel>
#include <QDateTime>
#include <QPixmap>
#include <iostream>
#include <QFile>
#include <QDesktopServices>
#include <QString>
#include <QTextCodec>

#include "xlsxdocument.h"
#include "xlsxformat.h"
#include "xlsxcellrange.h"
#include "xlsxchart.h"
#include"readonlydelegate.h"

using namespace std;

namespace Ui {
class goods;
}

class goods : public QMainWindow
{
    Q_OBJECT

public:
    explicit goods(QWidget *parent = nullptr);
    void onTableSelectChange(int row);
    void onTable2SelectChange(int row);
    void showPhoto();
    void oninformationChange();
    void refreshmodel1();
    void refreshmodel2();
    void refreshmodel3();
    void refreshmodel4();

//    void on_name_out_currentIndexChanged(int index);

    ~goods();
    static double gross_profit;
    static double gross_reveue;
    static double gross_cost;

private slots:
    void on_ok_clicked();

    void on_SearchAll_clicked();

    void on_SearchAll_2_clicked();

//    void on_add_clicked();

//    void on_delete_2_clicked();

    void on_search_clicked();

    void on_search_2_clicked();

    void on_revoke_clicked();

    void on_refresh_clicked();

    void on_uploadPicture_clicked();

    void on_instock_clicked();

    void on_tableView_2_clicked(const QModelIndex &index);

    void on_name_out_currentIndexChanged(int index);

    void on_outstock_clicked();

    void on_id_out_textChanged(const QString &arg1);

    void on_lineEdit_5_editingFinished();

    void on_num_out_editingFinished();

    void on_pushButton_clicked();

    void on_refresh_2_clicked();

    void on_tableView_3_clicked(const QModelIndex &index);

    void on_search_3_clicked();

    void on_SearchAll_3_clicked();

    void on_pushButton_2_clicked();

    void on_ordertoexcel_clicked();

    void on_searchall_clicked();

    void on_search_4_clicked();

    void on_comboBox_4_currentIndexChanged(int index);

private:
    Ui::goods *ui;
    QSqlTableModel *model1;
    QSqlTableModel *model2;
    QSqlTableModel *model3;
    QSqlTableModel *model4;
    QImage myPicImg;
};

#endif // GOODS_H
